#!/bin/bash
# server mysql backup

# init
dir=/home/test_back
user=root
pwd=arnm3zry
server=

#code for exec
cd $dir

date=`date +%Y_%m_%d`

filename="$server"_"$date".sql

mysqldump -u $user -p$pwd --all-databases > "$filename"

find $dir  -type f -mtime +7 -exec rm {} \;
